import Vue from 'vue'
import App from './App.vue'

//按需导入mint-ui组件
// import { Header, Swipe, SwipeItem, Button } from 'mint-ui'
// Vue.component(Header.name, Header)
// Vue.component(Swipe.name, Swipe)
// Vue.component(SwipeItem.name, SwipeItem)
// Vue.component(Button.name, Button)
import MintUI from 'mint-ui'
Vue.use(MintUI)
import 'mint-ui/lib/style.css'

// 安装 图片预览插件
import VuePreview from 'vue2-preview'
Vue.use(VuePreview)

//导入路由包vue-router
import VueRouter from 'vue-router'
//安装路由
Vue.use(VueRouter)

//导入vue-resource
import VueResource from 'vue-resource'
Vue.use(VueResource)

//设置请求的根路径 需在引入vue-resource之后
Vue.http.options.root = 'http://www.liulongbin.top:3005'
Vue.http.options.emulateJSON = true


// 导入格式化时间的插件
import moment from 'moment'
//定义全局的时间过滤器
Vue.filter('dateFormat', function (dataStr, pattern = "YYYY-MM-DD HH:mm:ss") {
    return moment(dataStr).format(pattern)
})

//导入mui样式
import './lib/mui/css/mui.min.css'
import './lib/mui/css/icons-extra.css'

//导入router.js
import router from './router.js'

Vue.config.productionTip = false

new Vue({
 render: h => h(App),
 router
}).$mount('#app')
